<?php
//----------------------------------------------------------------------------------------------------------
    require_once('../config.inc.php');

    require_once($config['app_dir'] . '/includes/session.class.php');
    require_once($config['app_dir'] . '/classes/profitplot.class.php');
    //---------------------------------------------------------------------------------------------------
    $Session = new objSession($config['app_id']);
    $ses_data_name = 'CalculatorPipTrade';//'CalculatorProfiTrade';
    if( !$Session->isExists($ses_data_name) || $Session->isEmpty($ses_data_name)) exit;
    //------------------------------------------------------------------------------------------------------
    try {

        $ProfitGraphModel = new objProfitGraphModel();
        $ProfitGraphModel->SetData($Session->Get($ses_data_name));
        //$ProfitGraphModel->Dump();
        if( $ProfitGraphModel->isEmpty() ) exit();

        $ProfitGraphView = new objProfitGraphView(330, 200);
        $ProfitGraphView->data_x = $ProfitGraphModel->getDataX();
        $ProfitGraphView->data_y = $ProfitGraphModel->getDataY();
        $ProfitGraphView->BuildGraph();

    } catch (Exception $e) {
        echo 'Error: ',  $e->getMessage(), "\n";
    }
    //-------------------------------------------------------------------------------------------------------
?>
